package com.doria.consumer.pojo.dto;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

@Data
public class LoginDto {

    @NotBlank(message = "账号必须填写")
    @Length(min = 8, max = 32, message = "限制8-32位字符")
    private String username;
    @NotBlank(message = "密码不能为空或者空格")
    @Pattern(regexp = "[A-Za-z0-9]+", message = "必须由数字和字母组成")
    @Length(min = 8, max = 32, message = "长度限制8-32位字符")
    private String password;
}
